﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Dictionary;
    using HRM.CORE;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Dictionary.ERP;
    using DevExpress.XtraGrid.Views.Base;

    public class xucAllowance1 : UserControl
    {
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarButtonItem bbiDelete;
        private GridColumn colAllowanceCode;
        private GridColumn colAllowanceName;
        private GridColumn colEmployeeCode;
        private GridColumn colIncomeTaxValue;
        private GridColumn colMoney;
        private GridColumn colSalaryTableListID;
        private IContainer components;
        private GridView gbList;
        private GridControl gcList;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridView gridView1;
        private string m_AllowanceCode;
        private string m_EmployeeCode;
        private double m_IncomeTaxValue;
        private decimal m_Money;
        private Guid m_SalaryTableListID;
        private PopupMenu ppMenu;
        private RepositoryItemGridLookUpEdit repAllowanceCode;
        private RepositoryItemGridLookUpEdit repAllowanceName;
        private RepositoryItemCalcEdit repMoney;
        private GridView repositoryItemGridLookUpEdit1View;

        public event SavedHandler Saved;

        public xucAllowance1()
        {
            this.components = null;
            this.m_SalaryTableListID = Guid.Empty;
            this.m_AllowanceCode = "";
            this.m_Money = 0M;
            this.m_IncomeTaxValue = 0.0;
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.InitMultiLanguages();
        }

        public xucAllowance1(Guid SalaryTableListID, string EmployeeCode)
        {
            this.components = null;
            this.m_SalaryTableListID = Guid.Empty;
            this.m_AllowanceCode = "";
            this.m_Money = 0M;
            this.m_IncomeTaxValue = 0.0;
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.Init(this.m_SalaryTableListID = SalaryTableListID, this.m_EmployeeCode = EmployeeCode);
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.gbList.DeleteSelectedRows();
        }

        private void cbo_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                xfmAllowanceAdd add = new xfmAllowanceAdd(Actions.Add);
                add.Added += new xfmAllowanceAdd.AddedEventHander(this.xfmAllowance_Added);
                add.ShowDialog();
            }
        }

        public void ClearData()
        {
            this.gcList.DataSource = null;
        }

        private void CreateRowData()
        {
            DIC_ALLOWANCE dic_allowance = new DIC_ALLOWANCE();
            dic_allowance.Get(this.m_AllowanceCode);
            this.gbList.SetFocusedRowCellValue(this.colEmployeeCode, this.m_EmployeeCode);
            this.gbList.SetFocusedRowCellValue(this.colAllowanceCode, dic_allowance.AllowanceCode);
            this.gbList.SetFocusedRowCellValue(this.colAllowanceName, dic_allowance.AllowanceCode);
            this.gbList.SetFocusedRowCellValue(this.colMoney, dic_allowance.MaximumMoney);
            this.gbList.SetFocusedRowCellValue(this.colIncomeTaxValue, dic_allowance.IncomeTaxValue);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private bool Exist(DataTable l_eAllowance, string AllowanceCode)
        {
            bool flag = false;
            foreach (DataRow row in l_eAllowance.Rows)
            {
                try
                {
                    if (AllowanceCode == row["AllowanceCode"].ToString())
                    {
                        flag = true;
                    }
                }
                catch
                {
                    flag = false;
                }
            }
            return (flag = false);
        }

        private void gbList_InitNewRow(object sender, InitNewRowEventArgs e)
        {
        }

        private void gbList_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                this.gbList.DeleteSelectedRows();
            }
            if (e.KeyCode == Keys.F5)
            {
                this.Init(this.m_SalaryTableListID, this.m_EmployeeCode);
            }
            if (e.KeyCode == Keys.Escape)
            {
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            }
        }

        private void gbList_KeyPress(object sender, KeyPressEventArgs e)
        {
        }

        private void gbList_ValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e)
        {
            if (this.Exist(this.gcList.DataSource as DataTable, this.m_AllowanceCode))
            {
                e.ErrorText = "Tr\x00f9ng phụ cấp - Nhấn ESC để phục hồi trạng th\x00e1i b\x00ecnh thường!";
                e.Valid = false;
            }
            else
            {
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            }
        }

        public void Init(Guid SalaryTableListID, string EmployeeCode)
        {
            this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu);
            DIC_ALLOWANCE dic_allowance = new DIC_ALLOWANCE();
            dic_allowance.AddRepositoryGridLookupEdit(this.repAllowanceCode);
            dic_allowance.AddRepositoryGridLookupEdit1(this.repAllowanceName);
            this.repAllowanceCode.EditValueChanged += new EventHandler(this.repAllowanceCode_EditValueChanged);
            this.repAllowanceCode.EditValueChanging += new ChangingEventHandler(this.repAllowanceCode_EditValueChanging);
            this.repAllowanceName.EditValueChanged += new EventHandler(this.repAllowanceName_EditValueChanged);
            this.repAllowanceName.EditValueChanging += new ChangingEventHandler(this.repAllowanceName_EditValueChanging);
            this.repMoney.EditValueChanging += new ChangingEventHandler(this.repMoney_EditValueChanging);
            this.repMoney.EditValueChanged += new EventHandler(this.repMoney_EditValueChanged);
            this.gcList.DataSource = new HRM_SALARY_ALLOWANCE().GetList(this.m_SalaryTableListID = SalaryTableListID, this.m_EmployeeCode = EmployeeCode);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucAllowance1));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            SerializableAppearanceObject obj3 = new SerializableAppearanceObject();
            this.gcList = new GridControl();
            this.gbList = new GridView();
            this.colSalaryTableListID = new GridColumn();
            this.colEmployeeCode = new GridColumn();
            this.colAllowanceCode = new GridColumn();
            this.repAllowanceCode = new RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new GridView();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.colAllowanceName = new GridColumn();
            this.repAllowanceName = new RepositoryItemGridLookUpEdit();
            this.gridView1 = new GridView();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.colMoney = new GridColumn();
            this.repMoney = new RepositoryItemCalcEdit();
            this.colIncomeTaxValue = new GridColumn();
            this.ppMenu = new PopupMenu(this.components);
            this.bbiDelete = new BarButtonItem();
            this.barManager1 = new BarManager(this.components);
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.repAllowanceCode.BeginInit();
            this.repositoryItemGridLookUpEdit1View.BeginInit();
            this.repAllowanceName.BeginInit();
            this.gridView1.BeginInit();
            this.repMoney.BeginInit();
            this.ppMenu.BeginInit();
            this.barManager1.BeginInit();
            base.SuspendLayout();
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gcList.EmbeddedNavigator.TextStringFormat = "{0}/{1}";
            this.gcList.Location = new Point(0, 0);
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.RepositoryItems.AddRange(new RepositoryItem[] { this.repAllowanceCode, this.repAllowanceName, this.repMoney });
            this.gcList.Size = new Size(0x372, 0x1e6);
            this.gcList.TabIndex = 4;
            this.gcList.UseEmbeddedNavigator = true;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Appearance.GroupRow.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gbList.Appearance.GroupRow.Options.UseFont = true;
            this.gbList.Appearance.HeaderPanel.Options.UseTextOptions = true;
            this.gbList.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
            this.gbList.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            this.gbList.BorderStyle = BorderStyles.NoBorder;
            this.gbList.Columns.AddRange(new GridColumn[] { this.colSalaryTableListID, this.colEmployeeCode, this.colAllowanceCode, this.colAllowanceName, this.colMoney, this.colIncomeTaxValue });
            this.gbList.GridControl = this.gcList;
            this.gbList.GroupPanelText = "K\x00e9o v\x00e0 Thả cột v\x00e0o đ\x00e2y để nh\x00f3m dữ liệu";
            this.gbList.IndicatorWidth = 40;
            this.gbList.Name = "gbList";
            this.gbList.OptionsBehavior.AllowIncrementalSearch = true;
            this.gbList.OptionsBehavior.AutoExpandAllGroups = true;
            this.gbList.OptionsBehavior.CopyToClipboardWithColumnHeaders = false;
            this.gbList.OptionsBehavior.FocusLeaveOnTab = true;
            this.gbList.OptionsLayout.StoreAllOptions = true;
            this.gbList.OptionsLayout.StoreAppearance = true;
            this.gbList.OptionsMenu.EnableColumnMenu = false;
            this.gbList.OptionsMenu.EnableGroupPanelMenu = false;
            this.gbList.OptionsNavigation.EnterMoveNextColumn = true;
            this.gbList.OptionsSelection.InvertSelection = true;
            this.gbList.OptionsSelection.MultiSelect = true;
            this.gbList.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
            this.gbList.OptionsView.ColumnAutoWidth = false;
            this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            this.gbList.OptionsView.RowAutoHeight = true;
            this.gbList.OptionsView.ShowGroupPanel = false;
            this.gbList.ValidatingEditor += new BaseContainerValidateEditorEventHandler(this.gbList_ValidatingEditor);
            this.gbList.InitNewRow += new InitNewRowEventHandler(this.gbList_InitNewRow);
            this.gbList.KeyDown += new KeyEventHandler(this.gbList_KeyDown);
            this.gbList.KeyPress += new KeyPressEventHandler(this.gbList_KeyPress);
            this.colSalaryTableListID.Caption = "M\x00e3 bảng lương";
            this.colSalaryTableListID.FieldName = "SalaryTableListID";
            this.colSalaryTableListID.Name = "colSalaryTableListID";
            this.colEmployeeCode.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.OptionsColumn.AllowEdit = false;
            this.colEmployeeCode.OptionsColumn.ReadOnly = true;
            this.colEmployeeCode.Width = 0x4d;
            this.colAllowanceCode.Caption = "M\x00e3 phụ cấp";
            this.colAllowanceCode.ColumnEdit = this.repAllowanceCode;
            this.colAllowanceCode.FieldName = "AllowanceCode";
            this.colAllowanceCode.Name = "colAllowanceCode";
            this.colAllowanceCode.Visible = true;
            this.colAllowanceCode.VisibleIndex = 0;
            this.colAllowanceCode.Width = 0x75;
            this.repAllowanceCode.AutoHeight = false;
            this.repAllowanceCode.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("repAllowanceCode.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.repAllowanceCode.DisplayFormat.FormatString = "{0:##,##0} VND";
            this.repAllowanceCode.EditFormat.FormatString = "{0:##,##0} VND";
            this.repAllowanceCode.Name = "repAllowanceCode";
            this.repAllowanceCode.NullText = "[Chọn m\x00e3 phụ cấp]";
            this.repAllowanceCode.View = this.repositoryItemGridLookUpEdit1View;
            this.repAllowanceCode.ButtonClick += new ButtonPressedEventHandler(this.cbo_ButtonClick);
            this.repositoryItemGridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn1, this.gridColumn2 });
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.gridColumn1.Caption = "M\x00e3 Phụ Cấp";
            this.gridColumn1.FieldName = "AllowanceCode";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "T\x00ean Phụ Cấp";
            this.gridColumn2.FieldName = "AllowanceName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.colAllowanceName.Caption = "T\x00ean phụ cấp";
            this.colAllowanceName.ColumnEdit = this.repAllowanceName;
            this.colAllowanceName.FieldName = "AllowanceCode";
            this.colAllowanceName.Name = "colAllowanceName";
            this.colAllowanceName.Visible = true;
            this.colAllowanceName.VisibleIndex = 1;
            this.colAllowanceName.Width = 0x115;
            this.repAllowanceName.AutoHeight = false;
            this.repAllowanceName.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("repAllowanceName.Buttons"), new KeyShortcut(Keys.None), obj3, "", null, null, true) });
            this.repAllowanceName.Name = "repAllowanceName";
            this.repAllowanceName.NullText = "[Chọn t\x00ean phụ cấp]";
            this.repAllowanceName.View = this.gridView1;
            this.repAllowanceName.ButtonClick += new ButtonPressedEventHandler(this.cbo_ButtonClick);
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridColumn3, this.gridColumn4 });
            this.gridView1.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridColumn3.Caption = "M\x00e3 Phụ Cấp";
            this.gridColumn3.FieldName = "AllowanceCode";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 0;
            this.gridColumn4.Caption = "T\x00ean Phụ Cấp";
            this.gridColumn4.FieldName = "AllowanceName";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 1;
            this.colMoney.Caption = "Số tiền hưởng (VND)";
            this.colMoney.ColumnEdit = this.repMoney;
            this.colMoney.FieldName = "Money";
            this.colMoney.Name = "colMoney";
            this.colMoney.Visible = true;
            this.colMoney.VisibleIndex = 2;
            this.colMoney.Width = 0x83;
            this.repMoney.AutoHeight = false;
            this.repMoney.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repMoney.Mask.UseMaskAsDisplayFormat = true;
            this.repMoney.Name = "repMoney";
            this.colIncomeTaxValue.Caption = "Giảm trừ thuế (%)";
            this.colIncomeTaxValue.ColumnEdit = this.repMoney;
            this.colIncomeTaxValue.FieldName = "IncomeTaxValue";
            this.colIncomeTaxValue.Name = "colIncomeTaxValue";
            this.colIncomeTaxValue.Visible = true;
            this.colIncomeTaxValue.VisibleIndex = 3;
            this.colIncomeTaxValue.Width = 0x79;
            this.ppMenu.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, BarItemPaintStyle.CaptionGlyph) });
            this.ppMenu.Manager = this.barManager1;
            this.ppMenu.Name = "ppMenu";
            this.bbiDelete.Caption = "X\x00f3a";
            this.bbiDelete.Id = 0;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiDelete });
            this.barManager1.MaxItemId = 1;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.gcList);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucAllowance1";
            base.Size = new Size(0x372, 0x1e6);
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.repAllowanceCode.EndInit();
            this.repositoryItemGridLookUpEdit1View.EndInit();
            this.repAllowanceName.EndInit();
            this.gridView1.EndInit();
            this.repMoney.EndInit();
            this.ppMenu.EndInit();
            this.barManager1.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.colEmployeeCode.Caption = MultiLanguages.GetString("tbl_DicAllowance", "EmployeeCode", this.colEmployeeCode.Caption);
            this.colAllowanceCode.Caption = MultiLanguages.GetString("tbl_DicAllowance", "AllowanceCode", this.colAllowanceCode.Caption);
            this.colAllowanceName.Caption = MultiLanguages.GetString("tbl_DicAllowance", "AllowanceName", this.colAllowanceName.Caption);
            this.colMoney.Caption = MultiLanguages.GetString("tbl_DicAllowance", "MaximumMoney", this.colMoney.Caption);
        }

        private void RaiseSavedHander()
        {
            if (this.Saved != null)
            {
                this.Saved(this);
            }
        }

        private void repAllowanceCode_EditValueChanged(object sender, EventArgs e)
        {
            if (this.Exist(this.gcList.DataSource as DataTable, this.m_AllowanceCode))
            {
                this.gbList.SetColumnError(this.colAllowanceCode, "Error");
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.None;
            }
            else
            {
                this.CreateRowData();
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            }
        }

        private void repAllowanceCode_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.m_AllowanceCode = e.NewValue.ToString();
        }

        private void repAllowanceName_EditValueChanged(object sender, EventArgs e)
        {
            if (this.Exist(this.gcList.DataSource as DataTable, this.m_AllowanceCode))
            {
                this.gbList.SetColumnError(this.colAllowanceName, "Error");
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.None;
            }
            else
            {
                this.CreateRowData();
                this.gbList.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            }
        }

        private void repAllowanceName_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.m_AllowanceCode = e.NewValue.ToString();
        }

        private void repMoney_EditValueChanged(object sender, EventArgs e)
        {
        }

        private void repMoney_EditValueChanging(object sender, ChangingEventArgs e)
        {
            try
            {
                this.m_Money = decimal.Parse(e.NewValue.ToString());
            }
            catch
            {
            }
        }

        public void Save()
        {
            HRM_SALARY_ALLOWANCE hrm_salary_allowance = new HRM_SALARY_ALLOWANCE();
            hrm_salary_allowance.Delete(this.m_SalaryTableListID, this.m_EmployeeCode);
            try
            {
                if ((this.gcList.DataSource as DataTable).Rows.Count > 0)
                {
                    foreach (DataRow row in (this.gcList.DataSource as DataTable).Rows)
                    {
                        try
                        {
                            if (row != null)
                            {
                                hrm_salary_allowance.Insert(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), decimal.Parse(row["Money"].ToString()), double.Parse(row["IncomeTaxValue"].ToString()));
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                this.UpdateEmployeeSalary();
                this.RaiseSavedHander();
            }
            catch
            {
            }
        }

        private void UpdateEmployeeSalary()
        {
            HRM_TIMEKEEPER_TABLELIST hrm_timekeeper_tablelist = new HRM_TIMEKEEPER_TABLELIST();
            HRM_SALARY_TABLELIST hrm_salary_tablelist = new HRM_SALARY_TABLELIST();
            hrm_salary_tablelist.GetByID(this.m_SalaryTableListID);
            hrm_timekeeper_tablelist.Get(hrm_salary_tablelist.Month, hrm_salary_tablelist.Year);
            HRM_SALARY.EmployeeUpdate(hrm_timekeeper_tablelist.TimeKeeperTableListID.ToString(), this.m_SalaryTableListID.ToString(), hrm_salary_tablelist.Month, hrm_salary_tablelist.Year, this.m_EmployeeCode);
        }

        private void xfmAllowance_Added(object sender, DIC_ALLOWANCE Item)
        {
            DIC_ALLOWANCE dic_allowance = new DIC_ALLOWANCE();
            dic_allowance.AddRepositoryGridLookupEdit(this.repAllowanceCode);
            dic_allowance.AddRepositoryGridLookupEdit1(this.repAllowanceName);
        }

        public delegate void SavedHandler(object sender);
    }
}

